package com.example.springboot2022nocv.controller;

import com.example.springboot2022nocv.entity.LineTrend;
import com.example.springboot2022nocv.entity.NocvData;
import com.example.springboot2022nocv.entity.NocvGlobalData;
import com.example.springboot2022nocv.service.GlobalService;
import com.example.springboot2022nocv.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class GlobalController {

    @Autowired
    private GlobalService globalService;

    //转到全球疫情地图
    @RequestMapping("/toGlobal")
    public  String toGlobal(){
        return "Global";
    }

    //查询全国疫情数据
    @RequestMapping("/queryGlobal")
    @ResponseBody
    public List<NocvGlobalData> queryGlobalData(){
        List<NocvGlobalData> list = globalService.list();
        return list;
    }

}
